@extends('shop::layouts.master')
@section('title')
    积分订单详情
@endsection
<style>
</style>
@section('tab')
    <div style="padding: 20px; background-color: #F2F2F2; ">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md6">
                <div class="layui-card">
                    <div class="layui-card-header">活动详情 - 【 {{$data['info']['msg']}} 】</div>
                    <div class="layui-card-body" >
                        活动图像：<img src="{{$data['info']['img']['full_src']}}" style="width: 80px; height: 80px;" /><br>
                        活动名称：{{$data['info']['title']}} <br>
                        活动类型：{{$data['info']['type']['type_msg']}}<br>
                        活动状态：{{$data['info']['status']['status_msg']}}<br>
                        活动时间：{{$data['info']['times']}}<br>
                        活动设置：
                        <table class="layui-table layui-form">
                            <thead>
                                <tr>
                                    <th>满（元）</th>
                                    <th>
                                        @if( $data['info']['type']['type'] == 1 )
                                            减（元）
                                        @else
                                            折扣（折）
                                        @endif
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                @foreach($data['info']['activity_extend'] as $k=>$val)
                                     <tr class="phono_ine">
                                        <td>{{ round( $val['price_all'] , 2 ) }}</td>
                                        <td>{{ round( $val['price'] , 2 ) }}</td>
                                    </tr>
                                @endforeach
                            </tbody>
                        </table>
                        <br>
                    </div>
                </div>
            </div>

            <div class="layui-col-md6">
                <div class="layui-card">
                    <div class="layui-card-header">活动统计</div>
                    <div class="layui-card-body" >
                        活动持续天数（天）：{{$data['data']['day']}}<br>
                        活动期间共产生订单数：{{$data['data']['order_total']}}<br>
                        <!-- 活动期间共销售商品（件）：--<br> -->
                        活动期间销售总额（元）：{{$data['data']['profit']}}<br>
                        获取期间参与用户（人）：{{$data['data']['user_num']}}<br>
                    </div>
                </div>
            </div>

            <div class="layui-col-md12" >
                <div class="layui-card">
                    <div class="layui-card-header">订单明细</div>
                    <table class="layui-hide" id="test"></table>
                </div>
            </div>

        </div>
    </div>

@endsection

@section('tab_js')
    <script>
        layui.use(['form', 'layer', 'jquery','table'], function () {
            $ = layui.jquery;
            var form = layui.form,
                layer = layui.layer,
                table = layui.table;
                table.render({
                    elem: '#test'
                    ,url:'{{route("shop_get_order_list",["activity_id"=>$data["info"]["id"]])}}'
                    ,height: 400
                    ,cols: [[
                      ,{field:'id',  title: 'ID', sort: true, fixed: 'left'}
                      ,{field:'order_no',  title: '订单号'}
                      // ,{field:'status_msg',  title: '订单状态'}
                        ,{field:'pay_status',  title: '支付状态'}
                        ,{field:'pay_time',  title: '支付时间'}
                        ,{field:'pay_type',  title: '支付方式'}
                      // ,{field:'type_msg',  title: '商品名称'}
                      ,{field:'user_name',  title: '购买用户'}
                      ,{field:'order_amount',  title: '订单总金额'}
                      ,{field:'pay_amount', title: '实际支付金额'}
                      ,{field:'coupon_price', title: '优惠金额'}
                       ,{field:'created_at', title: '下单时间'}

                    ]]
                    ,page: true
                });


        })
       </script>
@endsection      
